import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)


//引入
import Home from './views/Home.vue'
import Classify from './views/Classify.vue'
import Search from './views/Search.vue'
import Cart from './views/Cart.vue'
import Detail from './views/Detail.vue'
import Register from './views/Register.vue'
import Login from './views/Login.vue'



// 轮播图
import { Swipe, SwipeItem } from 'vant';
Vue.use(Swipe)
Vue.use(SwipeItem);

//倒计时
import { CountDown } from 'vant';
Vue.use(CountDown);

//通知栏
import { NoticeBar } from 'vant';
Vue.use(NoticeBar);

//分割线
import { Divider } from 'vant';
Vue.use(Divider);

//左边导航
import { Sidebar, SidebarItem } from 'vant';
Vue.use(Sidebar);
Vue.use(SidebarItem);

import { Tab, Tabs } from 'vant';
Vue.use(Tab).use(Tabs);

//评分
import { Rate } from 'vant';
Vue.use(Rate);

//详情下面导航
import {
  GoodsAction,
  GoodsActionIcon,
  GoodsActionButton
} from 'vant';
Vue
  .use(GoodsAction)
  .use(GoodsActionIcon)
  .use(GoodsActionButton);

  //提示
import { Toast } from 'vant';
Vue.use(Toast);

//按钮
import { Button } from 'vant';
Vue.use(Button);

//字体图标
import { Icon } from 'vant';
Vue.use(Icon);

//下拉刷新
import { PullRefresh } from 'vant';
Vue.use(PullRefresh);

//上传照片
import { Uploader } from 'vant';
Vue.use(Uploader);


export default new Router({
  routes: [
    {
      path: '/',
      name: 'home',
      component: Home
    },
    {
      path: '/home',
      name: 'home',
      component: Home
    },
    {
      path: '/classify',
      name: 'classify',
      component: Classify
    },
    {
      path: '/search',
      name: 'search',
      component: Search
    },
    {
      path: '/cart',
      name: 'cart',
      component: Cart
    },
    {
      path: '/detail/:goodsId',
      name: 'detail',
      component: Detail
    },
    {
      path: '/register',
      name: 'register',
      component: Register
    },
    {
      path: '/login',
      name: 'login',
      component: Login
    },

    {
      path: '/my',
      name: 'my',
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import(/* webpackChunkName: "about" */ './views/My.vue')
    }
  ]
})
